//
//  FQExplainViewController.swift
//  SwiftProject
//
//  Created by 董駸 on 2023/4/4.
//

import UIKit

class FQExplainViewController: BaseViewController {

    var type : Int = 0
    
    convenience init(type : Int = 0) {
        self.init()
        self.type = type
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
        navigationBarType = .light
    }
    
    override func initSubviews() {
        super.initSubviews()
        
        let scrollView = UIScrollView()
        view.addSubview(scrollView)
        
        scrollView.snp.makeConstraints { make in
            make.edges.equalToSuperview()
        }
        
        let image = UIImageView(imageString: "icon_explain_\(type + 1)")
        scrollView.addSubview(image)
        
        if type == 0 {
            image.snp.makeConstraints { make in
                make.left.equalTo(11)
                make.width.equalTo(SCREEN_WIDTH - 22)
                make.top.equalToSuperview()
                make.height.equalTo(644~)
            }
        } else {
            image.snp.makeConstraints { make in
                make.left.equalTo(0)
                make.width.equalTo(SCREEN_WIDTH)
                make.top.equalToSuperview()
                make.height.equalTo(796~)
            }
        }
    
        scrollView.layoutIfNeeded()
        scrollView.contentSize = CGSize(width: SCREEN_WIDTH, height: image.qmui_bottom + 20)
    }

    override func setupNavigationItems() {
        super.setupNavigationItems()
        if type == 0 {
            title = "身份认证说明"
        } else {
            title = "防骗小贴士"
        }
    }
    
    override func customNavigationBarTransitionKey() -> String? {
        "image"
    }

}
